package com.example.wastes.order.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.wastes.common.pojo.Order;
import com.example.wastes.order.mapper.OrderMapper;
import com.example.wastes.order.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements OrderService {
    @Autowired
    private OrderMapper orderMapper;

    @Override
    public List<Order> findAllName() {
        return orderMapper.findAllName();
    }

    @Override
    public List<Order> findOrderAddress(String address) {
        return orderMapper.findOrderAddress(address);
    }

    @Override
    public boolean addOrder(Order order) {
        return orderMapper.insertOrder(order) > 0;
    }

    @Override
    public boolean updateOrder(Order order) {
        return orderMapper.updateOrder(order) > 0;
    }

    @Override
    public boolean removeByOnumber(String onumber) {
        return orderMapper.deleteOrder(onumber) > 0;
    }

    @Override
    public List<Order> findAll() {
        return orderMapper.findAll();
    }
}
